From 99e3e3dc2cdf244f3b51166efc425d392d6e3a73 Mon Sep 17 00:00:00 2001 From: "cl349@firebug.cl.cam.ac.uk" Date: Tue, 13 Sep 2005 19:43:58 +0000 Subject: [PATCH] Free blkif if vbd_create fails. Signed-off-by: Christian Limpach --- linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c index bf9817a8f0..c081aa8240 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/xenbus.c @@ -170,7 +170,6 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) be->blkif = alloc_blkif(be->frontend_id); if (IS_ERR(be->blkif)) { - /* XXX SMH: should free blkif here... hmm */ err = PTR_ERR(be->blkif); be->blkif = NULL; xenbus_dev_error(dev, err, "creating block interface"); @@ -179,8 +178,8 @@ static void backend_changed(struct xenbus_watch *watch, const char *node) err = vbd_create(be->blkif, handle, be->pdev, be->readonly); if (err) { - /* XXX SMH: should free blkif here too... */ - be->blkif = NULL; + blkif_put(be->blkif); + be->blkif = NULL; xenbus_dev_error(dev, err, "creating vbd structure"); return; } -- 2.30.2